home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Sample.h
-
- Contains: Location Manager SDK Sample Module Rez/C includes
-
- Version: ALM SDK 2.0
- Package: Location Manager SDK 2.0
-
- Copyright: © 1996-1997 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: Please include the the file and version information (from above) with
- the problem description. Developers belonging to one of the Apple
- developer programs can submit bug reports to:
-
- devsupport@apple.com
-
- */
-
- #ifndef __SAMPLE__
- #define __SAMPLE__
-
- // -------------------------------------------------------------------------------------------------
-
- #ifdef REZ
-
- #include "Types.r"
-
- #else
-
- #include <Types.h>
-
- // Types...
-
- typedef struct {
- UInt32 version; // Version of the setting...
- SInt32 slot; // PC Card slot to eject...
- } SettingRec, *SettingPtr, **SettingHandle;
-
- // -------------------------------------------------------------------------------------------------
-
- typedef pascal OSStatus (*ResourceProc)(long);
-
- enum {
- uppxxxprocInfo = kPascalStackBased
- | RESULT_SIZE (SIZE_CODE(sizeof(OSStatus)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr ResourceProcUPP;
- #define CallResourceProc(userRoutine, params) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), ResourceProcInfo, params)
- #define NewResourceProcPPC(userRoutine) \
- (ResourceProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), ResourceProcInfo, kPowerPCISA)
- #define NewResourceProc68k(userRoutine) \
- (ResourceProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), ResourceProcInfo, kM68kISA)
- #else
- typedef ResourceProc ResourceProcUPP;
- #define CallResourceProc(userRoutine, params) \
- ((ResourceProc)(userRoutine))(params)
- #define NewResourceProcPPC(userRoutine) \
- (ResourceProcUPP)(userRoutine)
- #define NewResourceProc68k(userRoutine) \
- (ResourceProcUPP)(userRoutine)
- #endif
-
- #endif // REZ
-
- // -------------------------------------------------------------------------------------------------
-
- // Errors...
-
- // Other text...
-
- // Constants for common use...
-
- #define kNoSlotsID -1
- #define kBothSlotsID 0
- #define kLowerSlotID 1
- #define kUpperSlotID 2
-
- #define kNoRestart 0x00
- #define kRestartIfChanged 0x80
-
- #define kExecutableRsrcType 'code'
- #define kExecutableRsrcID 10000
-
- #define kNameRsrcType 'STR '
- #define kNameRsrcID 10000
-
- #define kDescRsrcType 'STR '
- #define kDescRsrcID 10001
-
- #define kIconRsrcType 'ICON'
- #define kIconRsrcID 10000
-
- #define kGetInfoRsrcID 10000
-
- #define kPPCCodeResource 'PPCC'
- #define kPPCCodeResourceID 10000
-
- #define kDescribeSettingStrings 10000
- /* Not needed because the STR# entries are number so that (**(SettingHandle)setting).slot + 2 works
- #define kDescribeNeither 1
- #define kDescribeBoth 2
- #define kDescribeLower 3
- #define kDescribeUpper 4
- */
-
- #define kModuleNotNeededErr 10000
- #define kNeedPCCardsErr 10001
- #define kNeedPCCard3Err 10002
-
- #define kDescribeErrorStrings 10001
- #define kDescribeResNotFound 1
- #define kDescribeNotNeeded 2
- #define kDescribeNeedPCCards 3
- #define kDescribeNeedPCCard3 4
-
- #define kEditMessageRsrcID 10000
- #define kEditOKButton 1
- #define kEditCancelButton 2
- #define kUpperPCCardCheckBox 3
- #define kLowerPCCardCheckBox 4
- // -------------------------------------------------------------------------------------------------
-
- #endif // __SAMPLE__
-